/*
 *  Author: Honrun
 */
#ifndef DEVICESLIST_H_INCLUDED
#define DEVICESLIST_H_INCLUDED

#include "stdint.h"


#define LIST_VALUE_MAX 0x7FFFFFFFFFFFFFFFULL


typedef struct ListStruct{
    struct ListStruct *prev;
    struct ListStruct *next;

    /* 链表节点排序值 */
    int64_t value;

    /* 当前节点所属 */
    void *pElement;
}ListType;



int8_t cListInit(ListType *ptypeNow, int64_t lValue);
int8_t cListInsert(ListType *ptypeHead, ListType *ptypeNow);
int8_t cListInsertBefore(ListType *ptypeBase, ListType *ptypeNow);
int8_t cListInsertAfter(ListType *ptypeBase, ListType *ptypeNow);
int8_t cListInsertHead(ListType *ptypeHead, ListType *ptypeNow);
int8_t cListInsertEnd(ListType *ptypeHead, ListType *ptypeNow);
int8_t cListRemove(ListType *ptypeNow);


#endif // DEVICESLIST_H_INCLUDED
